/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

import request from "../utils/request";

/**
 * 获取已关联公众号列表、小程序列表
 *  */
export async function getPlatformList(params) {
  return request("/v1/PlatformManage/Auth/platformList", {
    method: "POST",
    body: params,
  });
}

/**
 * 授权
 *  */
export async function authPlatform(params) {
  return request("/v1/PlatformManage/Auth/authPlatform", {
    method: "POST",
    body: params,
  });
}

/**
 * 获取授权二维码内容
 *  */
export async function getQrCodeInfo(params) {
  return request("/v1/PlatformManage/Auth/authQrcodeInfo", {
    method: "POST",
    body: params,
  });
}

/**
 * 获取绑定公众号、小程序二维码
 *  */
export async function getPlatformBindCode(params) {
  return request("/v1/PlatformManage/Auth/authQrcode", {
    method: "POST",
    body: params,
  });
}

/**
 * 取消关联
 *  */
export async function cancelPlatformBind(params) {
  return request("/Api/Handle/run", {
    method: "POST",
    body: {
      data: JSON.stringify({
        data: params,
        run: "/Delivery/cancleAssociate",
        time: new Date().getTime(),
      }),
    },
  });
}

/**
 * 轮询检查绑定结果
 *  */
export async function checkScanCodeStatus(params) {
  return request("/v1/PlatformManage/Auth/checkScanCodeStatus", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，数据中心，获取粉丝数据
 *  */
export async function getFansData(params) {
  return request("/v1/PlatformManage/FanStatistics/platformFanStatistics", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，数据中心，导出
 *  */
export async function dataCenterExport(params) {
  return request("/v1/PlatformManage/FanStatistics/fanStatisticsExport", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，数据中心，业务员、快宝驿站列表数据
 *  */
export async function wxGetDataCenterList(params) {
  return request("/v1/PlatformManage/FanStatistics/fanStatistics", {
    method: "POST",
    body: params,
  });
}

/**
 * 微信管理，群发推送，插入文本内容
 *  */
export async function insertText(params) {
  return request("/v1/PlatformManage/Push/publishPushTask", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，群发推送，检查是否有替换的模板链接
 *  */
export async function checkTemplate(params) {
  return request("/v1/PlatformManage/Push/getTemplateUrl", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，群发推送，保存模板链接
 *  */
export async function saveTemplate(params) {
  return request("/v1/PlatformManage/Push/setTemplateUrl", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，群发推送，添加关键词回复
 *  */
export async function addKeyWordReply(params) {
  return request("/v1/PlatformManage/Reply/addKeyWordReply", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，群发推送，关键词回复列表
 *  */
export async function getKeyWordReplyList(params) {
  return request("/v1/PlatformManage/Reply/keyWordReplyList", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，群发推送，删除关键词
 *  */
export async function delKeyWordReply(params) {
  return request("/v1/PlatformManage/Reply/delKeyWordReply", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，群发推送，修改关键词
 *  */
export async function editKeyWordReply(params) {
  return request("/v1/PlatformManage/Reply/upKeyWordReply", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，群发推送，测试关键词
 *  */
export async function testKeyWordReply(params) {
  return request("/v1/PlatformManage/Reply/testKeyWordReply", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，群发推送，被关注回复内容
 *  */
export async function getSubscribeReply(params) {
  return request("/v1/PlatformManage/Reply/subscribeReply", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，群发推送，编辑被关注回复内容
 *  */
export async function editSubscribeReply(params) {
  return request("/v1/PlatformManage/Reply/editSubscribeReply", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，二维码，业务员列表数据、快宝驿站列表数据
 *  */
export async function wxGetQrList(params) {
  return request("/v1/PlatformManage/Salesman/salesmanList", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，二维码，获取查看二维码链接
 *  */
export async function wxGetQrLink(params) {
  return request("/v1/PlatformManage/Qrcode/salesmanQrcode", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，二维码，创建导出任务
 *  */
export async function wxQrCreateExport(params) {
  return request("/v1/PlatformManage/Qrcode/exportSalesmanQrcode", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，二维码，获取导出结果进行下载
 *  */
export async function wxQrDownLoad(params) {
  return request("/v1/PlatformManage/Qrcode/exportSalesmanQrcodeFile", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，二维码，修改二维码业务员
 *  */
export async function changeQrcodeCourier(params) {
  return request("/v1/PlatformManage/Qrcode/changeQrcodeSalesman", {
    method: "POST",
    body: params,
  });
}

/**
 * 微信管理，设置，获取设置列表
 *  */
export async function wxGetSettingList() {
  return request("/v1/PlatformManage/Config/cityConfigInfo", {
    method: "POST",
  });
}
/**
 * 微信管理，设置，在线支付设置
 *  */
export async function wxOnlinePay(params) {
  return request("/Api/PayStatus/handlePayStatus", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，设置，关注公众号设置开启关闭
 *  */
export async function wxChangeSubscribeStatus(params) {
  return request("/Api/AttentionGzh/handleAttention", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，设置，开启/关闭积分功能
 *  */
export async function wxOpenScore(params) {
  return request("/Api/Integral/updateIntegralStatus", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，设置，积分功能，绑定云店账号
 *  */
export async function wxScoreBind(params) {
  return request("/Api/Integral/bindCloud", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，设置，积分功能，获取积分设置详情
 *  */
export async function getScoreDetail() {
  return request("/Api/Integral/showIntegral", {
    method: "GET",
  });
}
/**
 * 微信管理，设置，积分功能，保存积分设置
 *  */
export async function saveScore(params) {
  return request("/Api/Integral/handleIntegral", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，设置，广告位，获取广告位设置
 *  */
export async function getAdvSetting(params) {
  return request("/Api/Advertising/getChooseShowRecord", {
    method: "GET",
    data: params,
  });
}
/**
 * 微信管理，设置，广告位，设置广告位
 *  */
export async function setAdv(params) {
  return request("/Api/Advertising/setChooseShowRecord", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，设置，广告位，广告位列表
 *  */
export async function getAdvList(params) {
  return request("/Api/Advertising/showAdvertising", {
    method: "GET",
    data: params,
  });
}
/**
 * 微信管理，设置，广告位，删除广告位
 *  */
export async function deleteAdv(params) {
  return request("/Api/Advertising/deleteAdvertising", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，设置，广告位，广告位排序
 *  */
export async function sortAdv(params) {
  return request("/Api/Advertising/sortAdvertising", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，设置，广告位，添加广告
 *  */
export async function addAdv(params) {
  return request("/Api/Advertising/createAdvertising", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，设置，广告位，修改广告
 *  */
export async function editAdv(params) {
  return request("/Api/Advertising/updateAdvertising", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，设置，广告位，更改广告位状态
 *  */
export async function changeAdvStatus(params) {
  return request("/Api/Advertising/statusUpdate", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，设置，广告位，获取流量主广告设置列表
 *  */
export async function getMiniAdvList(params) {
  return request("/Api/Advertising/showFlowAd", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，设置，广告位，添加、设置流量主广告
 *  */
export async function setMiniAdv(params) {
  return request("/Api/Advertising/setFlowAd", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，设置，广告位，删除流量主广告
 *  */
export async function deleteMiniAdv(params) {
  return request("/Api/Advertising/delFlowAd", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，设置，广告位，流量主广告上下线
 *  */
export async function changeMiniAdvStatus(params) {
  return request("/Api/Advertising/setFlowAdStatus", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，设置，联系客服，获取客服信息
 *  */
export async function getServiceInfo() {
  return request("/Api/CustomerService/showService", {
    method: "GET",
  });
}
/**
 * 微信管理，设置，联系客服，修改添加客服信息
 *  */
export async function editServiceInfo(params) {
  return request("/Api/CustomerService/updateService", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，获取需要解绑平台的二维码
 *  */
export async function getUnbindQrCode(params) {
  return request("/v1/PlatformManage/Unbundle/unbundleQrcode", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，查询用户解绑的结果
 *  */
export async function checkUnBindRecord(params) {
  return request("/v1/PlatformManage/Unbundle/unbundleQrcodeInfo", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，设置，自定义菜单，获取自定义菜单
 *  */
export async function getMenuList(params) {
  return request("/v1/PlatformManage/Menu/menu", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，设置，自定义菜单，获取官方提供的公众号菜单
 *  */
export async function getOfficialMenu(params) {
  return request("/v1/PlatformManage/Menu/officialMenuList", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，设置，自定义菜单，获取官方提供的小程序菜单
 *  */
export async function getMiniProgramMenu(params) {
  return request("/v1/PlatformManage/Menu/miniProgramMenu", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，设置，自定义菜单，当用户选择同城急送内置链接时，检查用户是否开通此功能
 *  */
export async function checkHasOpenTCJS(params) {
  return request("/v1/PlatformManage/Menu/menuAuth", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，设置，自定义菜单，发布菜单
 *  */
export async function publishMenu(params) {
  return request("/v1/PlatformManage/Menu/publishMenu", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，设置，自定义菜单，复制系统菜单连接
 *  */
export async function copySystemURL(params) {
  return request("/v1/PlatformManage/Menu/wechatMenuUrl", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，设置，收益广告展示位置设置
 *  */
export async function setRevenueAdvShowPosition(params) {
  return request("/v1/PlatformManage/EarningsAdvertising/setShowPosition", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，设置，收益广告展示位置查询
 *  */
export async function getRevenueAdvShowPosition() {
  return request("/v1/PlatformManage/EarningsAdvertising/showPositionGet", {
    method: "GET",
  });
}
/**
 * 绑定驿站账号
 *  */
export async function bindYzAccount(params) {
  return request("/v1/PlatformManage/Config/setInnAccount", {
    method: "POST",
    body: params,
  });
}
/**
 * 解绑下属驿站
 *  */
export async function unBindSubYz(params) {
  return request("/v1/PlatformManage/Config/cancelInnAccount", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，设置，获取推广小程序配置
 *  */
export async function getPromoteMiniProgram(params) {
  return request("/v1/PlatformManage/Config/promoteMiniProgram", {
    method: "POST",
    body: params,
  });
}
/**
 * 微信管理，设置，编辑推广小程序配置
 *  */
export async function editPromoteMiniProgram(params) {
  return request("/v1/PlatformManage/Config/editPromoteMiniProgram", {
    method: "POST",
    body: params,
  });
}
/**
 * 获得新零售绑定的驿站信息
 *  */
export async function getBindInnAccount(params) {
  return request("/v1/PlatformManage/Config/getInnAccount", {
    method: "POST",
    body: params,
  });
}
/**
 * 是否新零售加盟商
 *  */
export async function isCityLeague(params) {
  return request("/v1/PlatformManage/Config/isCityLeague", {
    method: "POST",
    body: params,
  });
}
